import React,{PropsWithChildren} from 'react'
import {Navigate} from "react-router-dom"
import {anyAction} from "../untils/index" 


const Hog = (Com: anyAction) => {
  return (props:PropsWithChildren<object>)=>{
    const token=window.localStorage.getItem('token')
    if(!token){
       return <Navigate to={"/login"}></Navigate>
     }
     return <Com {...props}></Com>
  }
}

export default Hog